/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package mini_game_fx;

import javafx.event.EventHandler;
import javafx.scene.input.MouseDragEvent;

/**
 * This is a JavaFX version of Mini game Framework MouseDragEventRelayer
 * class.
 *
 * The original MiniGameEventRelayerFx class implements MouseListener,
 * MouseDragListener, and KeyListener. Instead, JavaFX do override the
 * handle() method to control each of events.
 *
 * @author Heecheon Kim
 * @author Taewan Kim
 * @author Jaewoong Shin
 */
public class MiniGameMouseDragEventRelayerFx implements EventHandler<MouseDragEvent> {

    // THE GAME FROM WHICH THE EVENTS WERE GENERATED
    private MiniGameFx game;
    
    /**
     * The constructor just sets up access to the game for which to respond
     * to.
     * 
     * @param initGameFx the game being played.
     */
    public MiniGameMouseDragEventRelayerFx(MiniGameFx initGameFx) {
        game = initGameFx;
    }
    
    /**
     * This method handles all types of mouse events by calling different
     * event methods according to the event type.
     * 
     * @param mde Mouse drag event.
     */
    @Override
    public void handle(MouseDragEvent mde) {
        System.out.println("HAHAHA");
        if(mde.getEventType() == MouseDragEvent.MOUSE_DRAG_ENTERED){
            
            System.out.println("Enter Drag");
            mouseDragEntered(mde);
        }
        else if(mde.getEventType() == MouseDragEvent.MOUSE_DRAG_EXITED) {
            System.out.println("Exit Drag");
            mouseDragExited(mde);
        }
        else if(mde.getEventType() == MouseDragEvent.MOUSE_DRAG_OVER) {
            System.out.println("Drag Over");
            mouseDragOver(mde);
        }
        else if(mde.getEventType() == MouseDragEvent.MOUSE_DRAG_RELEASED) {
            System.out.println("Drag Release");
            mouseDragReleased(mde);
        }
    }
    
    /**
     * WE WILL NOT USE THESE METHOD.
     * 
     * @param mde Mouse drag event associated with mouse drag typed.
     */
    public void mouseDragEntered(MouseDragEvent mde) {
        
    }
    
    /**
     * WE WILL NOT USE THESE METHOD.
     * 
     * @param mde Mouse drag event associated with mouse drag typed.
     */
    public void mouseDragExited(MouseDragEvent mde) {
        
    }
    
    /**
     * WE WILL NOT USE THESE METHOD.
     * 
     * @param mde Mouse drag event associated with mouse drag typed.
     */
    public void mouseDragOver(MouseDragEvent mde) {
        
    }
    
    /**
     * WE WILL NOT USE THESE METHOD.
     * 
     * @param mde Mouse drag event associated with mouse drag typed.
     */
    public void mouseDragReleased(MouseDragEvent mde) {
        
    }
}